package com.zhaolang.qogir.ui.adapter.settings;

import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.TextView;

import com.zhaolang.qogir.R;
import com.zhaolang.qogir.bean.ManageAllComments;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class SettingsBTAdapter extends ArrayAdapter<BluetoothDevice> {
    private Context mContext;
    private List<String> devList;
    private String TAG = "SettingsBTAdapter";

    public SettingsBTAdapter(Context context) {
        super(context, 0);
        this.mContext = context;
    }

    public void setData(List<String> comments) {
        this.devList = comments;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {
        Log.d(TAG, "SettingsBTAdapter comment adapter position:" + position);
        BluetoothDevice device = getItem(position);
        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.ui_settings_bt_item, null);
        }

        TextView tvDeviceName = convertView.findViewById(R.id.tv_printer_name);
        tvDeviceName.setText(device.getName());

        return convertView;
    }
}
